package com.learn.other.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.learn.other.pojo.User;
import com.learn.other.service.UserService;
import com.learn.other.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
* @author DJJ_F
* @description 针对表【user】的数据库操作Service实现
 * 没加事务时有报错，但是修改了
* @createDate 2025-03-28 14:11:14
*/
@Transactional
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User>
    implements UserService{
    @Override
    public boolean updateUserName(String name, Long id) {
        User user = new User();
        user.setId(id);
        user.setName(name);
        boolean b = updateById(user);
        String s = null;
        s.toString();
        return b;
    }
}




